﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Jzy.BLL.Project;
using System.Collections.Generic;
using Frame.Lib.Core.Tree;
using Frame.Lib.Utilities;



public partial class Project_Task_SelectUser : System.Web.UI.Page
{
    private ProjectBO _prj = new ProjectBO();
    private string PrjID
    {
        get
        {
            return Request["PrjID"];
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindTree();
        }
    }

    private void BindTree()
    {
        DataTable dt = _prj.GetPrjMembers(PrjID);
        tvList.ShowLines = true;

        List<int> lstSelectIDs = StrUtil.SplitToInt(Request["SelectID"]);

        foreach (DataRow dr in dt.Rows)
        {
            TreeNode node = new TreeNode(dr["UserName"].ToString(), dr["UserID"].ToString());
            node.Value = dr["UserID"].ToString();
            node.Text = TreeBO<TreeInfo>.GetCheckBoxNode(dr["UserID"], dr["UserName"], null);
            node.SelectAction = TreeNodeSelectAction.Expand;
           
            tvList.Nodes.Add(node);
        }

        JSUtil.SetTreeSelect(lstSelectIDs);

    }
   
}
